<?php
/*
Overmundo, cultura de todo o Brasil
Desenvolvido pela Tecnopop para o Núcleo de Idéias Movimento
Copyright (C) 2006  Núcleo de Idéias Movimento

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*/

header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
	session_start();
	if ($_SESSION["estavaEm"] == "/estaticas/notfound.php") {
		$_SESSION["estavaEm"] = "/";
	}
	if ($_SESSION["meuPermalink"]) {
		$estavaEm = $_SESSION["meuPermalink"];
	} else {
		$estavaEm = $_SESSION["estavaEm"];
	}
	
	unset($_SESSION['usuarioValido']);
	session_unregister("usuarioValido");
	session_unset("usuarioValido");
	setcookie("lembraUsuario", "", time()-(3600),'/');
	setcookie("hashUsuario", "", time()-(3600),'/');
	
		// overmixter
 		define("CC_USER_COOKIE", "lepsog2");
        setcookie(CC_USER_COOKIE,"",time()-(3600),"/");
        unset($_COOKIE[CC_USER_COOKIE]);
		unset($_SESSION["CC_GLOBALS"]);
		session_unregister("CC_GLOBALS");
		session_unset("CC_GLOBALS");
		unset($CC_GLOBALS["loginUsuario"]);
        unset($CC_GLOBALS["codUsuario"]);
		
	if ($estavaEm) {
		header('location: ' . $estavaEm);
	} else {
		header('location: /');
	}
	exit();
?>
